﻿using System.Globalization;

namespace Sidvall.Resources
{
    public class ResourceManager
    {
        #region Public Members

        public Sidvall.Resources.IResourceProvider ResourceProvider { get; set; }

        #region GetString

        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
        public string GetString(string key)
        {
            if (this.ResourceProvider != null)
                return this.ResourceProvider.GetString(null, key);
            return key;
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
        public string GetString(string key, CultureInfo culture)
        {
            if (this.ResourceProvider != null)
                return this.ResourceProvider.GetString(null, key, culture);
            return key;
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
        public string GetString(string group, string key)
        {
            if (this.ResourceProvider != null)
                return this.ResourceProvider.GetString(group, key);
            return key;
        }
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")]
        public string GetString(string group, string key, CultureInfo culture)
        {
            if (this.ResourceProvider != null)
                return this.ResourceProvider.GetString(group, key, culture);
            return key;
        }

        #endregion

        #region ToString

        public override string ToString()
        {
            return "ResourceManager - Sidvall.Resources.IResourceProvider";
        }

        #endregion

        #endregion
        #region Constructors

        public ResourceManager(Sidvall.Resources.IResourceProvider resourceProvider)
        {
            this.ResourceProvider = resourceProvider;
        }

        #endregion
    }
}
